<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/6/23
  Time: 17:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <title>分润结果查询接口调用DEMO</title>
    <meta content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" name="viewport">
    <link rel="stylesheet" type="text/css" media="screen" href="static/bootstrap-3.3.5/css/bootstrap.css"/>
    <script type="text/javascript" src="static/jquery/jquery-3.0.0.js"></script>
    <script type="text/javascript" src="static/bootstrap-3.3.5/js/bootstrap.js"></script>
</head>
<body>

<div class="container">
    <fieldset>
        <legend>分润结果查询接口调用DEMO</legend>
        <form class="form-horizontal"  method="post" role="form" id="profit-result-form">

            <div class="form-group">
                <label for="merOrderId" class="control-label col-sm-2">商户订单号：</label>
                <div class="col-sm-6">
                    <input type="text" id="merOrderId" name="merOrderId" class="form-control" placeholder="请输入商户订单号"
                           value="${profitResult.merOrderId}"/>
                </div>
            </div>
            <div class="form-group">
                <label for="batchNo" class="control-label col-sm-2">批次号：</label>
                <div class="col-sm-6">
                    <input type="text" id="batchNo" name="batchNo" class="form-control" placeholder="请输入批次号"
                           value="${profitResult.batchNo}"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-6">
                    <button type="button" id="profit-result-btn" class="btn btn-info">支付</button>
                </div>
            </div>

            <div class="form-group">
                <label for="pay-result" class="col-sm-2 control-label">支付结果：</label>
                <div class="col-sm-6">
                    <textarea id="pay-result" class="col-sm-10 form-control" rows="5"></textarea>
                </div>
            </div>
        </form>
    </fieldset>
</div>
</body>
<script type="text/javascript">
    $(function () {

        $("#profit-result-btn").click(function () {
            $.ajax({
                url: "profit_result//do_profit_result",
                type: "post",
                dataType: "json",
                data: {
                    merOrderId:$("#merOrderId").val(),
                    batchNo:$("#batchNo").val()
                },
                success: function (data) {
                    $("#pay-result").html(JSON.stringify(data));
                },
                error: function (e) {
                    $("#pay-result").html(e);
                }
            });
        });
    })
</script>
</html>
